<% extends 'base.html' %>
<% block title %>送货列表<% endblock %>
<% block body %>
<% block head %>
    <script type="text/javascript" src='http://res.wx.qq.com/open/js/jweixin-1.0.0.js'></script>
<% endblock %>
<div class='page' ms-controller='delivery-list' >
    <header class="bar bar-nav">
        <div class="bar" >
          <div class="searchbar ">
            <!-- <a class='search-scan-code' ms-click='scanCode'>扫码</a> -->
            <div class="search-input">
              <label class="icon icon-search" for="search"></label>
              <input type="search" placeholder='手动输入需要添加的出库单...' ms-duplex='search_word' />
              <div class='search-input-type'>{{search_word_display}}</div>
              <div class='card search-metal'>
                <ul>
                    <li ms-click="do_choose('all')">搜索全部：{{search_word}}</li>
                    <li ms-click="do_choose('partner')">搜索客户：{{search_word}}</li>
                    <li ms-click="do_choose('picking')">搜索单据：{{search_word}}</li>
                </ul>
              </div>
            </div>
          </div>
        </div>
    </header>

    <div class="content" >
        <input name='hidden' id='hidden_user' value='${user_id}' ms-visible='false' />
        <div ms-repeat-picking='pickings' ms-visible='!picking.hidden'>
            <div class='card delivery-picking-show' >
                <div class='weixin-flex delivery-picking-header row' ms-click='choose(picking)'>
                    <div class='picking-col-10'><span class='circle-choose' ms-class='circle-choosed:picking.choose' /></div>
                    <div class='picking-col-80'>
                        <div class='delivery-picking-header-title'>
                            <span>{{picking.name}}</span>
                            <span>{{picking.partner}}</span>
                        </div>

                        <div class='delivery-picking-header-content'>{{picking.address}}</div>
                    </div>
                    <div class='delivery-picking-header-icon col-10'>
                        <span class='icon icon-left' ms-visible='!picking.is_display_detail' ms-click='display_detail($event, picking)'></span>
                        <span class='icon icon-down' ms-visible='picking.is_display_detail'  ms-click='display_detail($event, picking)'></span>
                    </div>
                </div>

                <div class='delivery-picking-detail' ms-visible='picking.is_display_detail' >
                    <ul>
                        <li ms-repeat='picking.lines'>
                            <div class='weixin-flex delivery-picking-detail-line row'>
                                <img class='col-20' ms-attr-src='/website/image/product.product/{{el.product_id}}/image' />
                                <div class='col-60' ><span>{{el.product_name}}</span></div>
                                <div class='col-20 pull-right' >X<span>{{el.product_qty}}</span></div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

        <div class='weixin-flex delivery-picking-tab'>
            <div class='picking-col-10'>
                <span class='circle-choose' ms-class='circle-choosed:every_choose' ms-click='all_choose()' />
            </div>
            <div class='picking-col-10'><span>全选</span></div>
            <div class='picking-col-80 picking-done'>
                <span ms-class='picking-disable:!some_choose' ms-click='picking_done()'>送货完成</span>
            </div>
        </div>

        <div ms-class='content-mask:choose_metal' ></div>

        <div id='picking-choose-metal' >
            <div ms-repeat-picking='search_pickings' >
                <div class='card delivery-picking-show'>
                    <div class='weixin-flex delivery-picking-header row' ms-click='metal_choose(picking)'>
                        <div class='picking-col-10'><span class='circle-choose' ms-class='circle-choosed:picking.choose' /></div>
                        <div class='picking-col-80'>
                            <div class='delivery-picking-header-title'>
                                <span>{{picking.name}}</span>
                                <span>{{picking.partner}}</span>
                            </div>

                            <div class='delivery-picking-header-content'>{{picking.address}}</div>
                        </div>
                        <div class='delivery-picking-header-icon col-10'>
                            <span class='icon icon-left' ms-visible='!picking.is_display_detail' ms-click='display_detail($event, picking)'></span>
                            <span class='icon icon-down' ms-visible='picking.is_display_detail'  ms-click='display_detail($event, picking)'></span>
                        </div>
                    </div>

                    <div class='delivery-picking-detail' ms-visible='picking.is_display_detail' >
                        <ul>
                            <li ms-repeat='picking.lines'>
                                <div class='weixin-flex delivery-picking-detail-line row'>
                                    <img class='col-20' ms-attr-src='/website/image/product.product/{{el.product_id}}/image' />
                                    <div class='col-60' ><span>{{el.product_name}}</span></div>
                                    <div class='col-20 pull-right' >X<span>{{el.product_qty}}</span></div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="content-block">
              <div class="row">
                  <div class="col-50" ms-click='metal_cancel'><a class="button button-fill button-danger">取消</a></div>
                  <div class="col-50" ms-click='metal_submit'><a class="button button-fill button-success">提交</a></div>
              </div>
            </div>
        </div>
    </div>
</div>



<% endblock %>

<% block script %>
    ${ super() }
    <script type="text/javascript" src="/dftg_weixin/static/src/js/delivery_list.js"></script>
<% endblock %>
